﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using NetCoreCMS.Common;
using NetCoreCMS.IServices;
using NetCoreCMS.Models;
namespace NetCoreCMS.Web.Areas.Admin.Controllers.Dialog
{
    public class Dialog_Category_SpecController : ManageController
    {
        private const string WEB_VIEW = "~/Areas/Admin/Views/Dialog/dialog_category_spec.cshtml";
        protected int channel_id;
        public IArticle_specService _article_spc { get; set; }
        public ActionResult Index()
        {
            this.channel_id = int.Parse(HttpContext.Request.Query["channel_id"].FirstOrDefault()); //获取频道ID
            RptBind("where parent_id=0 ");
            return View(WEB_VIEW);
        }

        #region 数据绑定=================================
        private void RptBind(string _strWhere)
        {
            ViewData["list"] = _article_spc.GetList(_strWhere).OrderBy(a => a.sort_id).OrderByDescending(a => a.id).ToList();
        }
        #endregion
    }
}
